/*
 * Copyright (c) 2017 22420103@QQ.COM 版权所有
 */
package com.lehe.common.utils;

import org.apache.commons.lang.time.DateUtils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * 日期工具类继承org.apache.commons.lang.time.DateUtils<br>
 * @see org.apache.commons.lang.time.DateUtils
 * 
 * @author 王丹
 * @FileName DateUtil.java<br>
 * @Language Java<br>
 * @date 2016-01-08<br>
 */
public class DateUtil extends DateUtils {

	public static String parseLong(Long date, String pattern) {
		Calendar c = Calendar.getInstance();
		c.setTimeInMillis(date);
		SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
		return dateFormat.format(c.getTime());
	}

	public static String getNowDateTime(String format) {
		SimpleDateFormat dateFormat = new SimpleDateFormat(format);
		return dateFormat.format(Calendar.getInstance().getTime());
	}
}
